package entity

import "github.com/lib/pq"

type Message struct {
	Id int64 `gorm:"column:id;type:BIGINT;primary_key" json:"id"`

	UserId int64 `gorm:"column:user_id;type:BIGINT" json:"user_id"`

	PushType int `gorm:"column:push_type;type:TINYINT" json:"push_type"`

	PushRange int `gorm:"column:push_range;type:TINYINT" json:"push_range"`

	PushTime int `gorm:"column:push_time;type:TINYINT" json:"push_time"`

	Title string `gorm:"column:title;type:VARCHAR(255)" json:"title"`

	Content string `gorm:"column:content;type:VARCHAR(255)" json:"content"`

	Delay int64 `gorm:"column:delay;type:BIGINT" json:"delay"`

	UserIds pq.Int64Array `gorm:"column:user_ids;type:BIGINT[]" json:"user_ids"`

	DeletedAt int64 `gorm:"column:deleted_at;type:BIGINT" json:"deleted_at"`

	CreatedAt int64 `gorm:"column:created_at;type:BIGINT" json:"created_at"`

	UpdatedAt int64 `gorm:"column:updated_at;type:BIGINT" json:"updated_at"`
}

func (a *Message) TableName() string {
	return "messages"
}
